#define _CRT_SECURE_NO_WARNINGS 1#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
int main()
{
	int k = 0;
	scanf("%d", &k);
	int arr[] = { 1,2,3,4,5,6,7,8,9 };
	int sz = sizeof(arr) / sizeof(arr[0]);
	int l = 0, r = sz - 1;
	while (l<=r)
	{
		int mid = (l + r) / 2;
		if (arr[mid] > k)
		{
			r = mid - 1;
		}
		else if (arr[mid] < k)
			l = mid + 1;
		else
		{
			printf("%d", mid);
			break;
		}
		
	}

	return 0;
}